<?php


// list_buttons
echo '<div class="list_buttons">';

// list_button_add
if (isset($is_tree, $parent_id) && $is_tree) {
	$add_url = array('action' => 'add', $parent_id, 'autoPage' => TRUE);
} elseif (isset($has_rubric, $rubric_id) && $has_rubric) {
	$add_url = array('action' => 'add', $rubric_id, 'autoPage' => TRUE);
} else {
	$add_url = array('action' => 'add', 'autoPage' => TRUE);
}
echo '<div class="list_button list_button_add">' . $routine->button('add', __('add_action', TRUE), $add_url) . '</div>';

// list_button_parent_back / list_button_rubric_back
if (isset($is_tree, $parent_id) && $is_tree) {
	$parent_back_url = array('action' => 'back', 'id' => $parent_id, 'autoPage' => FALSE);
	echo '<div class="list_button list_button_parent_back">' . $routine->button('arrow_up', __('parent_index_action', TRUE), $parent_back_url) . '</div>';
	$root_back_url = array('action' => 'index', 'autoPage' => FALSE);
	echo '<div class="list_button list_button_parent_back">' . $routine->button('arrow_turn_left', __('root_index_action', TRUE), $root_back_url) . '</div>';
} elseif (isset($has_rubric, $rubric_id) && $has_rubric) {
	$rubric_back_url = array('action' => 'rubric_back', 'id' => $rubric_id, 'autoPage' => FALSE);
	echo '<div class="list_button list_button_rubric_back">' . $routine->button('arrow_up', __('rubric_index_action', TRUE), $rubric_back_url) . '</div>';
} elseif (isset($has_rubric) && $has_rubric && !isset($rubric_id)) {
	$rubric_back_url = array('action' => 'rubric_back', 'autoPage' => FALSE);
	echo '<div class="list_button list_button_rubric_back">' . $routine->button('arrow_up', __('rubric_index_action', TRUE), $rubric_back_url) . '</div>';
}

// list_button_filter
/*if (!$session->check('AdminFilter.' . $model)) {
	$button_text = $routine->icon('find') . ' ' . __('filter_action', TRUE);
	$button_attrs = array('onclick' => 'jQuery(\'.list_button_filter\').hide(); jQuery(\'.list_filter\').show();');
	echo '<div class="list_button list_button_filter">' . $html->tag('button', $button_text, $button_attrs) . '</div>';
}*/

echo '</div>'; // end of list_buttons


?>